<?php
class ModelTotalSubTotal extends Model {
	public function getTotal(&$total_data, &$total, &$taxes,$is_special=false) {
		$this->load->language('total/sub_total');
		$sub_total = $this->cart->getSubTotal($is_special);
		if (isset($this->session->data['vouchers']) && $this->session->data['vouchers']) {
			foreach ($this->session->data['vouchers'] as $voucher) {
				$sub_total += $voucher['amount'];
			}
		}

		$total_data[] = array(
			'code'       => 'sub_total',
			'title'      => $this->language->get('text_sub_total'),
			'value'      => $sub_total,
			'sort_order' => $this->config->get('sub_total_sort_order'),
		    'type' =>1//1:小计  2:总计   3:折扣   4:秒杀  5:使用券  6:运费
		);
		$total += $sub_total;
	}
}